package com.huige.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @Author 朱志辉
 * @Create 2024/7/18 上午3:38
 * @Version 1.0
 * Description:  可以被web项目加载，会初始化ioc容器，会设置dispatcherServlet地址
 */
public class SpringMvcInit  extends AbstractAnnotationConfigDispatcherServletInitializer{

    //service mapper层的ioc容器的配置类
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }


    //设置我们项目对应的配置类  springmvc controller
    
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{MvcConfig.class};
    }

    //配置springmvc内部自带servlet的映射路径
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
